#ifndef __HELLOWORLD_SCENE_H__
#define __HELLOWORLD_SCENE_H__

#include "cocos2d.h"
USING_NS_CC;

class HelloWorld : public cocos2d::CCLayerColor
{
public:
	HelloWorld();
	~HelloWorld();
    virtual bool init();  
    static cocos2d::CCScene* scene();
    void menuCloseCallback(CCObject* pSender);
    CREATE_FUNC(HelloWorld);
	CCSprite *nhanvat;
	CCSprite* chim;
	CCSprite* quai;
	CCSprite* pause;
		CCSprite* nen;
	CCMenuItemImage* pquit;
	CCAnimation* animnhanvat;
	CCAnimation* animnhanvat1;
	CCAnimation* animnhanvat2;
	CCAnimation* animnhanvat3;
	CCAnimation* animnhanvat4;
	CCActionInterval* actnhanvat;
	CCActionInterval* actnhanvat1;
	CCActionInterval* actnhanvat2;
	CCActionInterval* actnhanvat3;
	CCActionInterval* actnhanvat4;

	CCActionInterval* actquai;

	CCSize s;
	CCParticleSystemQuad *system;
	void spriteMoveFinished(CCNode* sender);
	void resetgame(CCObject* pSender);
	void addvatcan();
	void addchim();
	void adddayphai();
	void adddaytrai();
	void addquai();
	void addnvtieuphai();
	void addnvtieutrai();
	void addnhanvat(float dt);

	void stargame(CCObject* pSender);
	void callfuntion(CCNode* sender);
	void gamepause(CCObject* pSender);
	void vacham(float dt);
	void vachamcombo(float dt);
	void update(float dt);
	void combo(float dt);
	void endcombo(float dt);
	void end(float dt);
	void callvachamchim(float dt);
	void callvachamsoc(float dt);
	void callvachambom(float dt);
	void calllich(float dt);
	void gameplay(float dt);
	bool ccTouchBegan(CCTouch *pTouch, CCEvent *pEvent);
    void onTouchMoved(CCTouch touch, CCEvent* event);
    void onTouchEnded(CCTouch touch, CCEvent* event);
	CCLabelTTF *labeldiem;
	int diem;
	int aa1;
	int setvachamchim;
	int setvachamsoc;
	float time;
	int setvachambom;
	float v;
	float vquai;
	float vchim;
	float vsoc;
	float vbom;
	int aa;
	int b;
	protected:
	cocos2d::CCArray *_arrtuongtrai;
	cocos2d::CCArray *_arrtuongphai;
	cocos2d::CCArray *_arrvatcan;
	cocos2d::CCArray *_arrquai;
	cocos2d::CCArray *_arrchim;
	cocos2d::CCArray *_arrdayphai;
	cocos2d::CCArray *_arrdaytrai;
	cocos2d::CCArray *_arrnhanvat;
	cocos2d::CCArray *_arrnvtieuphai;
	cocos2d::CCArray *_arrnvtieutrai;
		
};

#endif // __HELLOWORLD_SCENE_H__

/*this->removeChildByTag(999);
		CCSprite *test = CCSprite::create("test.png", CCRectMake(0, 0, 
			soc-> getContentSize().width * soc->getScaleX(),
			soc-> getContentSize().height * soc->getScaleY()));
		test->setAnchorPoint(CCPointZero);
		test->setPosition(ccp(point.x - (soc->getContentSize().width/2 * soc->getScaleX()),
			point.y - (soc->getContentSize().height/2 * soc->getScaleY())));
		test->setOpacity(150);
		test->setTag(999);
		this->addChild(test);*/

//this->removeChildByTag(999);
	//CCSprite *test = CCSprite::create("test.png", CCRectMake(0, 0, 
	//bom->getContentSize().width,
	//bom->getContentSize().height));
	//test->setAnchorPoint(CCPointZero);
	//test -> setPosition(point1);
	////test->setPosition(ccp(bom->getPosition().x - (bom->getContentSize().width/2),
	////bom->getPosition().y - (bom->getContentSize().height/2)));
	//test->setOpacity(150);
	//test->setTag(999);
	//this->addChild(test);	

/*this->removeChildByTag(999);
	CCSprite *test = CCSprite::create("test.png", CCRectMake(0, 0, 
	nhanvat->getContentSize().width,
	nhanvat->getContentSize().height));
	test->setAnchorPoint(CCPointZero);
	test->setPosition(ccp(nhanvat->getPosition().x - (nhanvat->getContentSize().width/2),
	nhanvat->getPosition().y - (nhanvat->getContentSize().height/2)));
	test->setOpacity(150);
	test->setTag(999);
	this->addChild(test);	*/